package com.atlin.project.model.vo.biProduces;

import com.atlin.project.model.domain.BiProductsOrder;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 示例表
 *
 * @TableName biProductsOrder
 */
@Data
public class BiProductsOrderVO implements Serializable {
    /**
     * id
     */
    private Long id;

    /**
     * BI产品ID
     */
    private Long biProduceId;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 订单总价
     */
    private BigDecimal totalPrice;

    /**
     * 状态 0 - 待支付 1 - 已支付 2 - 过期 3 - 异常
     */
    private Integer status;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;


    /**
     * 包装类转对象
     *
     * @param biProductsOrderVO
     * @return
     */
    public static BiProductsOrder voToObj(BiProductsOrderVO biProductsOrderVO) {
        if (biProductsOrderVO == null) {
            return null;
        }
        BiProductsOrder biProductsOrder = new BiProductsOrder();
        BeanUtils.copyProperties(biProductsOrderVO, biProductsOrder);

        return biProductsOrder;
    }


    /**
     * 对象转包装类
     *
     * @param biProductsOrder
     * @return
     */
    public static BiProductsOrderVO objToVo(BiProductsOrder biProductsOrder) {
        if (biProductsOrder == null) {
            return null;
        }
        BiProductsOrderVO biProductsOrderVO = new BiProductsOrderVO();
        BeanUtils.copyProperties(biProductsOrder, biProductsOrderVO);

        return biProductsOrderVO;
    }

    private static final long serialVersionUID = 1L;
}